﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;
using System.IO;
using Microsoft.Xna.Framework.Storage;

namespace TankBattle.Models
{
    public class Player
    {
        #region Variable 

        private int score;
        private int level;
        private int status;
        private int life;
        private string name;

        #endregion

        #region Contruction

        public Player()
        {
            Intallization();
        }
        public Player(string name)
        {
            this.name = name;
            Intallization();
        }

        #endregion 

        #region Function 

        private void Intallization()
        {
            if (name == null) name = "AnyOne";
            this.level = Constant.PLAYER_START_LEVEL;
            this.life = Constant.PLAYER_START_LIFE;
            this.score = Constant.PLAYER_START_SCORE;
        }
        public void UpScore()
        {
            score += Constant.PLAYER_UP_SCORE;
        }
        public void Reset()
        {
            Intallization();
        }
        public void SetHighScore()
        {

        }
        public void UpLevel()
        {
            level++;
        }
        public void Init()
        {
            if (status == Constant.PLAYER_STATUS_LOSE)
                Reset();
        }
        #endregion 

        #region Properties

        public int SCORE
        {
            get { return score; }
        }
        public int LEVEL
        {
            get { return level; }
        }
        public int STATUS
        {
            get { return status; }
            set { status = value; }
        }
        public int LIFE
        {
            get { return life; }
            set { life = value; }
        }
        public string NAME
        {
            get { return name; }
        }
        #endregion 
    }
}
